<template>
  <div class="topLeft">
    <DecTitle text="任务进度" />
    <div class="plan-production">
      <div class="percent">
        <div class="item">
          <CenterChart id="1" :tips="61" :colorObj="rate[0].colorData" />
          <span style="color: rgba(4, 163, 235, 1)">切割达标率</span>
        </div>
        <div class="item">
          <CenterChart id="2" :tips="32" :colorObj="rate[1].colorData" />
          <span style="color: rgba(61, 251, 170, 1)">磨边达标率</span>
        </div>
        <div class="item">
          <CenterChart id="3" :tips="78" :colorObj="rate[2].colorData" />
          <span style="color: rgba(244, 139, 1, 1)">钢化达标率</span>
        </div>
        <div class="item">
          <CenterChart id="4" :tips="21" :colorObj="rate[3].colorData" />
          <span style="color: rgba(244, 2, 61, 1)">中空达标率</span>
        </div>
        <!-- <div class="item bg-color-black">
            <span>硬盘使用率</span>
            <CenterChart
              :id="rate[1].id"
              :tips="Number(serverList.hd)"
              :colorObj="rate[1].colorData"
            />
          </div> -->
      </div>
    </div>
  </div>
</template>

<script>
import DecTitle from "@/components/decTitle";
import CenterChart from "@/components/echart/center/centerChartRate";
export default {
  props: {
    deviceList: {
      type: Array,
      default: () => {
        return [];
      },
    },
    serverTime: {
      type: String,
      default: "0",
    },
    serverList: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  components: {
    DecTitle,
    CenterChart,
  },
  data() {
    return {
      data: [],
      rate: [
        {
          id: "centerRate1",
          tips: 60,
          colorData: {
            textStyle: "#3fc0fb",
            series: {
              color: ["rgba(4, 163, 235,0.4)", "transparent"],
              dataColor: {
                normal: "rgba(4, 163, 235,1)",
                shadowColor: "#97e2f5",
              },
            },
          },
        },
        {
          id: "centerRate2",
          tips: 40,
          colorData: {
            textStyle: "#67e0e3",
            series: {
              color: ["rgba(61, 251, 170,0.4)", "transparent"],
              dataColor: {
                normal: "rgba(61, 251, 170,1)",
                shadowColor: "#97e2f5",
              },
            },
          },
        },
        {
          id: "centerRate4",
          tips: 40,
          colorData: {
            textStyle: "#67e0e3",
            series: {
              color: ["rgba(244, 139, 1,0.3)", "transparent"],
              dataColor: {
                normal: "rgba(244, 139, 1,1)",
                shadowColor: "#97e2f5",
              },
            },
          },
        },
        {
          id: "centerRate4",
          tips: 40,
          colorData: {
            textStyle: "#67e0e3",
            series: {
              color: ["rgba(244, 2, 611,0.3)", "transparent"],
              dataColor: {
                normal: "rgba(244, 2, 61,1)",
                shadowColor: "#97e2f5",
              },
            },
          },
        },
      ],
    };
  },
};
</script>

<style lang="scss" scoped>
.topLeft {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.plan-production {
  flex: 1;
  display: flex;
  //   align-items: center;
  padding-top: 30px;
}

.percent {
  width: 100%;
  height: 75%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  .item {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    span {
      display: flex;
      justify-content: center;
    }
  }
}
</style>